#!/usr/bin/ruby
require "rubygems"
require "mailfactory"

mail_builder = MailFactory.new
mail_builder.to = "caiknife@gmail.com"
mail_builder.from = "caiknife@gmail.com"
mail_builder.subject = "The document"
mail_builder.text = "Here is that document you wanted."
mail_builder.attach("/home/caiknife/phpinfo.txt") if File.exist?("/home/caiknife/phpinfo.txt")

puts mail_builder.to_s